package com.demo.service.impl;

import com.demo.dao.LodgingDAO;
import com.demo.dao.impl.LodgingDAOImpl;
import com.demo.service.LodgingService;
import com.demo.vo.Lodging;

import java.io.Serializable;
import java.util.Map;

/**
 * 住宿模块的Service层（业务层）的具体实现类，对LodgingService接口中定义的抽象方法作出具体的功能实现
 */
public class LodgingServiceImpl implements LodgingService {
    //@Override
    public void add(Lodging vo) {
        LodgingDAO lodgingDAO = new LodgingDAOImpl();
        lodgingDAO.add(vo);
    }

    //@Override
    public void delete(long id) {
        LodgingDAO lodgingDAO = new LodgingDAOImpl();
        lodgingDAO.delete(id);
    }

    //@Override
    public void update(Lodging vo) {
        LodgingDAO lodgingDAO = new LodgingDAOImpl();
        lodgingDAO.update(vo);
    }

    //@Override
    public Lodging get(Serializable id) {
        LodgingDAO lodgingDAO = new LodgingDAOImpl();
        return lodgingDAO.get(id);
    }

    //@Override
    public Map<String, Object> list(Map<String, Object> params) {
        LodgingDAO lodgingDAO = new LodgingDAOImpl();
        return lodgingDAO.list(params);
    }
}
